/*
 *    Copyright (c) 2018-2025, bfcloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: bfcloud
 */

import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/appr-contract/hetongzbnd/page',
    method: 'get',
    params: query
  })
}

export function getObj(id) {
  return request({
    url: '/appr-contract/hetonghtcj/' + id,
    method: 'get'
  })
}

export function getTitleName() {
  return request({
    url: '/appr-contract/hetonghtcj/getTitle',
    method: 'get'
  })
}

export function submitStatus(id) {
    return request({
      url: '/appr-contract/hetongzbnd/'+id,
      method: 'get'
    })
}

export function submitStatusAll(query) {
    return request({
      url: '/appr-contract/hetongzbnd/submitStatusAll',
      method: 'post',
      data: query
    })
}

// 发约人组织结构
export function fayuetree(query) {
  return request({
    url: '/appr-contract/hetonghtcj/fayuetree',
    method: 'get',
    params: query
  })
}

// 受约人组织结构
export function shouyuetree(query) {
  return request({
    url: '/appr-contract/hetonghtcj/shouyuetree',
    method: 'get',
    params: query
  })
}

// 获取指标拟定部分
export function getNiDingList(query) {
  return request({
    url: '/appr-contract/hetonghtcj/getNiDingList',
    method: 'get',
    params: query
  })
}
// 合同保存
export function saveHtong(obj) {
  return request({
    url: '/appr-contract/wftest/saveHtong',
    method: 'post',
    data: obj
  })
}

// 合同信息返回值
export function page(query) {
  return request({
    url: '/appr-contract/hetonghtcj/page',
    method: 'get',
    params: query
  })
}

export function getShow(query) {
  return request({
    url: '/appr-contract/hetonghtzbnd/getShow',
    method: 'post',
    data: query
  })
}

// 合同推送拟定
export function Htongndts(query) {
  return request({
    url: '/appr-contract/hetonghtcj/hetongndts',
    method: 'get',
    params: query
  })
}
// 推送文本审核
export function tuisongwenben(id) {
  return request({
    url: '/appr-contract/hetonghtcj/tuisongwenben/'+id,
    method: 'get'
  })
}
// 发起签订
export function faqiqianding(id) {
  return request({
    url: '/appr-contract/hetonghtcj/faqiqianding/'+id,
    method: 'get'
  })
}

// 批量删除
export function deleteBatchHtcj(query) {
  return request({
    url: '/appr-contract/hetonghtcj/deleteBatch',
    method: 'get',
    params: query
  })
}
//批量审核
export function updateplshByid(query) {
  return request({
    url: '/appr-contract/hetonghtcj/updateplshByid',
    method: 'get',
    params: query
  })
}
export function gethtlist(id) {
  return request({
    url: '/appr-contract/hetonghtcj/'+id,
    method: 'get'
  })
}
export function setwbsh(id,wbsh) {
  return request({
    url: '/appr-contract/hetonghtcj/wenbenshenhe/'+id+'/'+wbsh,
    method: 'get'
  })
}
export function selecthtgzById(id) {
  return request({
    url: '/appr-contract/hetonghtcj/selecthtgzById/'+id,
    method: 'get'
  })
}

export function getSumWeight(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getSumWeight',
    method: 'get',
    params: query
  })
}
